
const path = require('path');
const copyDir = require('recursive-copy');
const utils = require('../utils');
const del = require('del');

exports.process = async (ctx, task) => {

    const { pdir } = ctx;

    const pjsMap = {};
    const files = [];

    await utils.deepLookUpDir(pdir, ['.git', '.tmp'], async (filename, filePath) => {
        if (filename.endsWith('.process.js')) {
            pjsMap[filePath.replace('.process.js', '')] = true;
        } else {
            files.push({ filename, filePath });
        }
    });
    ctx['needProcess'] = pjsMap;
    ctx['files'] = files;

}
